package com.yc.favorite.mapper;

import com.yc.favorite.entity.Tag;
import com.yc.favorite.entity.Tagfavorite;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author ly
 * @since 2023-10-24
 */
public interface TagfavoriteMapper extends BaseMapper<Tagfavorite> {

    @Insert("insert into tagfavorite values(#{tid},#{fid})")
    int insert(Tagfavorite tagfavorite);

    @Select("select * from tagfavorite where fid = #{fid}")
    List<Tagfavorite> selectByFid(int fid);

    @Select("select * from tagfavorite where tid = #{tid}")
    List<Tagfavorite> selectByTid(int tid);

    @Delete("delete from tagfavorite where fid = #{fid}")
    void deleteByFid(int fid);
}
